﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Routing;
using System.ServiceModel.Activation;
using System.Web.Mvc;
using System.Web.Http;

using Microsoft.Practices.Unity;

using ERPStore.Extensions;
using ERPStore.Web.Routing;

namespace ERPStore.ProductRating
{
	public class PluginInit : ERPStore.Extensibility.PluginInit
	{
		public PluginInit()
		{
			Container = GlobalConfiguration.Configuration.DependencyResolver.GetContainer();
		}

		Microsoft.Practices.Unity.IUnityContainer Container { get; set; }
		public override void RegisterRoutes()
		{
			base.RegisterRoutes();

			RouteTable.Routes.MapHttpRoute(
				"ProductRatingApi"
				, "api/productrating/{action}/{*id}"
				, new { controller = "RatingApi", action = "Ping", id = UrlParameter.Optional }
			);

		}

	}
}
